You are here: Statements and Functions > Location()
Syntax samples
LOCATION()
Attr1 = LOCATION()
IF LOCATION() = 2 THEN WAIT 4 MIN
Returns the current location’s name-index number. This function is especially useful in macros and subroutines that vary depending on which location’s logic calls them. By using a LOCATION() function with an IF...THEN statement, the macro or subroutine can act differently depending on the location that called it. Also, the same technique can be used to determine which location is carrying out a process when ALL is used as the process location.
Any logic.
Example
The individual ovens of a ceramics plant have different capacities, but are otherwise exactly the same. While each oven could be modeled as an individual location, it would be easier to model this situation as a multi-unit location. This example uses CAP() and LOCATION() in the processing logic of the parent location to accumulate enough Sinks to fill each oven.
Process Table
Entity |
Location |
Operation (min) |
---|---|---|
Sink |
Oven |
ACCUM CAP(LOCATION()) |
Routing Table
Blk |
Output |
Destination |
Rule |
Move Logic |
---|---|---|---|---|
1 |
Sink |
Cool |
FIRST 1 |
MOVE FOR 5 |
LOC() and ENTITY().